Skip to content

Security — Snyk SAST hardening (path traversal, rate limiting, ignore policy)#3

Merged
AstroNoob-Tools merged 16 commits intomainfrom
snyk-security-fixes
Feb 25, 2026
Merged

Security — Snyk SAST hardening (path traversal, rate limiting, ignore policy)#3
AstroNoob-Tools merged 16 commits intomainfrom
snyk-security-fixes

Conversation

@AstroNoob-Tools
Copy link
Owner

Summary

  • isAllowedPath() helper — post-resolve allowlist check on all 15 path-accepting endpoints; validates resolved path starts with a Windows drive-letter root ([A-Z]:\) or UNC path (\server\share), replacing the previous includes('..') denylist approach (CWE-22)
  • Rate limiting — added lightLimiter (200 req/min) tier; applied to the 7 previously-unthrottled routes (GET /, GET /api/image, GET /api/browse/validate, GET /api/import/detect-seestar, POST /api/config, POST /api/favorites/add, POST /api/favorites/remove)
  • All snyk-ignore inline suppressions removed — endpoints that now have proper controls no longer need comment-based suppression
  • .snyk policy file — clarified that Snyk Code (SAST) ignores are not read from this file; must be managed via Snyk web platform
  • notes/SNYK_IGNORE_REASONS.md — reference file with all 44 finding UUIDs and copy-paste reasons for adding web-platform ignores
  • GitHub Actions — Snyk CI workflow debug/verification commits included from branch

Test plan

  • npm start — server starts, browser opens, all features work normally
  • snyk test — 0 vulnerable dependency paths
  • Verify rate limiting does not block normal usage (limits are generous: 200/min for GET, 30/min for writes)
  • Verify folder browser still navigates any drive (isAllowedPath allows all [A-Z]:\ roots)

- catalogParser: detect -sub (Alt/Az) and _sub (EQ) suffixes; add mountMode field
- fileAnalyzer: dual subFolderEq/subFolderAltAz fields per object; mountMode ('eq'|'altaz'|'both')
- importService/mergeService/diskSpaceValidator: isSubframeNonFit() matches both -sub and _sub
- fileCleanup: iterate both sub-folders for cleanup and info; deleteSessionFiles accepts {folder,file} subFiles
- server.js: session delete API no longer needs subFolderPath
- dashboard: Mount Mode column in objects table; mode-aware badges and sub-folder cards in detail view; context-aware cleanup confirmation messages
…ion time fallback for objects without sub-frames
Added a verification step to check if SNYK_TOKEN is present before running Snyk tests.
…zePath() wrapper

All sanitizePath() call sites replaced with explicit inline checks:
- Reject input if it contains '..'
- Call path.resolve() directly so static analysis can track sanitisation
- Removed unused sanitizePath() helper function

mergeService.js: path.join() → path.resolve() when constructing destination
paths from file.relativePath, providing defence-in-depth at the write sink.
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@AstroNoob-Tools AstroNoob-Tools merged commit 620c569 into main Feb 25, 2026
5 checks passed
@AstroNoob-Tools AstroNoob-Tools deleted the snyk-security-fixes branch March 2, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant